package com.scsj.supermarket.view.activity.shopermodel;

import android.os.Bundle;
import android.support.v4.view.ViewPager;

import com.gigamole.navigationtabstrip.NavigationTabStrip;
import com.scsj.supermarket.R;
import com.scsj.supermarket.adapter.MainFragmentAdapter;
import com.scsj.supermarket.view.activity.baseactivitymodel.BaseActivity;
import com.scsj.supermarket.view.fragment.basemodel.BaseFragment;

import java.util.ArrayList;


/**
 * 店家申请审核记录页面
 */

public class ApplicationRecordActivity extends BaseActivity {

    private NavigationTabStrip mTopNavigationTabStrip;
    private ViewPager mViewPager;
    private ArrayList<BaseFragment> fragmentList;
    private MainFragmentAdapter mAdpter;
    private String[] title = {"审核中", "已完成"};

    @Override
    protected void createView(Bundle savedInstanceState) {
        setContentView(R.layout.activity_application_record);

        initView();
        initListener();
        initData();
    }

    @Override
    protected void initView() {
        intiNavigationBar();
    }

    @Override
    protected void initListener() {
    }

    @Override
    protected void initData() {
    }

    private void intiNavigationBar() {

        mTopNavigationTabStrip =  findViewById(R.id.mediator_tab);
        mViewPager = findViewById(R.id.viewpager);
        mViewPager.setOffscreenPageLimit(2);
        fragmentList = new ArrayList<>();
        for (int a= 0;a<title.length;a++){
            fragmentList.add(new ApplicationRecordFragment());
        }
        mAdpter = new MainFragmentAdapter(getSupportFragmentManager(), fragmentList);
        mViewPager.setAdapter(mAdpter);
        mTopNavigationTabStrip.setViewPager(mViewPager, 0);
        mTopNavigationTabStrip.setTitles(title);
        mTopNavigationTabStrip.setStripType(NavigationTabStrip.StripType.LINE);
        mTopNavigationTabStrip.setStripGravity(NavigationTabStrip.StripGravity.BOTTOM);
        mTopNavigationTabStrip.setTabIndex(0, true);
    }
}
